import java.util.*;

public class TextDemo {
    public static void func1(int[] array){
        Set<Integer> set = new HashSet<>();
        for(int i = 0;i<array.length;i++){
            if(set.contains(array[i])){
                array[i] = 0;
            }else{
                set.add(array[i]);
            }
        }
    }
    public static void func2(int[] array){
        Map<Integer,Integer> map = new HashMap<>();
        Set<Integer> set = new HashSet<>();
        for(int value : array){
            map.put(value,map.getOrDefault(value,0)+1);
            if(map.get(value)==1){
                set.add(value);
            }else{
                set.remove(value);
            }
        }
        System.out.println(set);

    }
    public static void func3(int[] array){

    }
    public static void main(String[] args) {
        int[] array = new int[10_0000];
        Random random = new Random();
        for(int i = 0;i<array.length;i++){
            array[i] = random.nextInt(10_0000);
        }
        func1(array);
        System.out.println(Arrays.toString(array));

    }
    public static void main1(String[] args) {
        Map<String ,Integer> map = new HashMap<>();
        HashBuck hashBuck = new HashBuck();
        hashBuck.put(1,2);
        hashBuck.put(4,85);
        hashBuck.put(36,43);
        hashBuck.put(5 ,2);
        hashBuck.put(7,9);
        hashBuck.put(2,32);
        hashBuck.put(32,82);
        hashBuck.put(17,9);
        System.out.println();
    }
}
